﻿@model VoteSystem.Models.OpResult
@{
    Layout = null;
    System.Collections.Generic.List<VoteSystem.Models.Position> Positions = ViewBag.Positions;
}

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>Matrix Admin</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="~/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="~/css/uniform.css" />
    <link rel="stylesheet" href="~/css/select2.css" />
    <link rel="stylesheet" href="~/css/matrix-style2.css" />
    <link rel="stylesheet" href="~/css/matrix-media.css" />
    <style>
        .disabled {
            background-color:#ddddff;
            color:red;
        }
        table {
            color:black;
            font-weight:bold;
        }
    </style>
</head>
<body>

    <div id="content">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    @if( Positions ==null || Positions.Count == 0 ){ //还没有导入数据
                    <div class="widget-box">
                        <div class="widget-title">
                            <span class="icon"><i class="icon-align-justify"></i></span>
                            <h5>导入岗位EXCEL</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <form action="/config/importposition" method="post" class="form-horizontal"  enctype = "multipart/form-data">
                                <div class="control-group">
                                    <label class="control-label">选择岗位excel :</label>
                                    <div class="controls">
                                        <input type="file" name="PositionFile" class="span11" placeholder="" />
                                       @if(Model != null)
                                       {
                                         <span>@Model.ErrorMessage</span>
                                       }
                                    </div>
                                </div>
                                <div class="form-actions">
                                    <button type="submit" class="btn btn-success">上传</button>
                                </div>
                            </form>
                        </div>
                    </div>
                    }
                    else 
                    {
                        <div class="widget-box">
                            <table class="table">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>科室</th>
                                        <th>职位</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @for (int i = 0; i < Positions.Count; i++ )
                                    {
                                        var position = Positions[i];
                                       <tr>
                                           <td>@(i+1)</td>
                                           <td>@position.DeptName</td>
                                           <td>@position.PositionName</td>
                                       </tr> 
                                    }
                                </tbody>
                            </table>
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>

    <script src="~/js/jquery.min.js"></script>
    <script src="~/js/jquery.ui.custom.js"></script>
    <script src="~/js/bootstrap.min.js"></script>
    <script src="~/js/jquery.uniform.js"></script>
    <script src="~/js/select2.min.js"></script>
    <script src="~/js/jquery.dataTables.min.js"></script>
    <script src="~/js/matrix.js"></script>
    <script src="~/js/matrix.tables.js"></script>
    <script src="~/js/underscore-min.js"></script>
    <script type="text/javascript">


    </script>
</body>
</html>
